<template>
  <div :class="['s-header-tabs-body', centered ? 'justify-content-center' : ''] ">
    <ul>
      <slot></slot>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HTabs",
  props: {
    activeKey: {
      type: [String, Number],
      required: true
    },
    centered: {
      type: Boolean,
      default: true
    }
  },
  data () {
    return {
    }
  },
  methods: {
    handleTabClick (index) {
      this.$emit('handleClick', index)
    }
  },
}
</script>

<style>
  .s-header-tabs-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
  }
  .s-header-tabs-body ul {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0;
    padding-left: 0;
  }
  .justify-content-center {
    justify-content: center!important;
  }
  .tabs-item {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  .s-header-tabs-body .item-link {
    padding: 0 1rem;
    margin-right: 20px;
    min-width: 80px;
    color: #333;
    display: block;
    text-align: center;
    height: calc(100% - 2px);
  }
  .item-link.active, .item-link:hover{
    color: #4e8afa;
    border-bottom: 2px solid #4e8afa;
  }
</style>
